home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1995 #5 & #6
/
Amiga Plus CD - 1995 - No. 5 and 6.iso
/
pd
/
serien
/
purity
/
nr.37
/
battclock
/
units
/
battclockplus.p
< prev
next >
Wrap
Text File
|
1994-09-17
|
2KB
|
108 lines
{ Unit: BattClockPlus
Version: 1.04 (1993-1994)
Meaning: read battclock: all battclock data (see BattclockLight)
for: KP2.12/OS2 or MaxonPASCAL3
Copyright: FW, you must use authors name in Info or Doc
Author: PackMAN
c/o Falk Zühlsdorff
Lindenberg 66
D-98693 Ilmenau / Thuringia }
UNIT BattClockPlus;
INTERFACE
{$opt q}
Uses UTILITY;
{$ INCL 'resources/battclock.h'}
FUNCTION GetBattClock(dt:boolean):boolean;
VAR mday,month,year,
hour,min,sec:word;
wday,battclocktime,
battclockdate:string;
IMPLEMENTATION
FUNCTION GetBattClock;
VAR current:p_ClockData;
BEGIN
BattclockBase:=OpenResource(BATTCLOCKNAME);
IF (BattclockBase<>NIL) AND (UtilityBase<>NIL)
THEN
BEGIN
NEW(current);
Amiga2Date(ReadBattClock,current);
IF dt THEN
case current^.wday of
0: wday:='Sonntag ';
1: wday:='Montag ';
2: wday:='Dienstag ';
3: wday:='Mittwoch ';
4: wday:='Donnerstag ';
5: wday:='Freitag ';
6: wday:='Samstag ';
else;end
ELSE
case current^.wday of
0: wday:='Sunday ';
1: wday:='Monday ';
2: wday:='Tuesday ';
3: wday:='Wednesday ';
4: wday:='Thursday ';
5: wday:='Friday ';
6: wday:='Saturday ';
else;end;
battclockdate:='';
IF current^.mday<10
THEN battclockdate:=('0'+INTSTR(current^.mday)+'.')
ELSE battclockdate:=(INTSTR(current^.mday)+'.');
IF current^.month<10
THEN battclockdate:=(battclockdate+'0'+INTSTR(current^.month)+
'.'+INTSTR(current^.year))
ELSE battclockdate:=(battclockdate+INTSTR(current^.month)+'.'+
INTSTR(current^.year));
mday:=current^.mday;
month:=current^.month;
year:=current^.year;
hour:=current^.hour;
min:=current^.min;
sec:=current^.sec;
battclocktime:='';
IF current^.hour<10
THEN battclocktime:=('0'+INTSTR(current^.hour)+':')
ELSE battclocktime:=(INTSTR(current^.hour)+':');
IF current^.min<10
THEN battclocktime:=(battclocktime+'0'+INTSTR(current^.min)+':')
ELSE battclocktime:=(battclocktime+INTSTR(current^.min)+':');
IF current^.sec<10
THEN battclocktime:=(battclocktime+'0'+INTSTR(current^.sec))
ELSE battclocktime:=(battclocktime+INTSTR(current^.sec));
GetBattclock:=true;
END
ELSE
GetBattclock:=false;
END;
END.